home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.2r / card_6668.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  105 lines

  1. -- card: 6668 from stack: in.2r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3837
  5. -- name: PopUpMenu
  6. ----- HyperTalk script -----
  7. on closecard
  8.   hide message window
  9. end closecard
  10.  
  11.  
  12. -- part 1 (button)
  13. -- low flags: 00
  14. -- high flags: A004
  15. -- rect: left=227 top=32 right=51 bottom=288
  16. -- title width / last selected line: 0
  17. -- icon id / first selected line: 0 / 0
  18. -- text alignment: 1
  19. -- font id: 0
  20. -- text size: 12
  21. -- style flags: 0
  22. -- line height: 16
  23. -- part name: Example
  24. ----- HyperTalk script -----
  25. on mousedown
  26.   if the optionkey is down then
  27.     edit script of target
  28.     exit mousedown
  29.   end if
  30.  
  31.   put the mouseloc into myPlace
  32.   put item 1 of myPlace - 20 into horiz
  33.   put item 2 of myPlace - 10 into vert
  34.   get PopUpMenu("Hello;my;name;is;Steve", 1, vert, horiz)
  35.   put "You chose item" && it
  36. end mousedown
  37.  
  38.  
  39.  
  40. -- part 2 (button)
  41. -- low flags: 00
  42. -- high flags: A004
  43. -- rect: left=299 top=32 right=51 bottom=360
  44. -- title width / last selected line: 0
  45. -- icon id / first selected line: 0 / 0
  46. -- text alignment: 1
  47. -- font id: 0
  48. -- text size: 12
  49. -- style flags: 0
  50. -- line height: 16
  51. -- part name: Another
  52. ----- HyperTalk script -----
  53. on mousedown
  54.   if the optionkey is down then
  55.     edit script of target
  56.     exit mousedown
  57.   end if
  58.  
  59.   put the mouseloc into myPlace
  60.   put item 1 of myPlace - 20 into horiz
  61.   put item 2 of myPlace - 10 into vert
  62.   get PopUpMenu("For;a;disk;catalog;of;BMUG's;stack;library;"& "Send;$3;To;BMUG;1442A;Walnut;#62;Berkeley;CA;94709", 5, vert, horiz)
  63.   put "You chose item" && it
  64. end mousedown
  65.  
  66.  
  67.  
  68. -- part contents for background part 10
  69. ----- text -----
  70. 3
  71.  
  72. -- part contents for background part 5
  73. ----- text -----
  74. PopUpMenu
  75.  
  76. -- part contents for background part 6
  77. ----- text -----
  78.  
  79. This HyperCard external function returns the selection from a popup menu created from a hypercard item list (the first parameter).  The
  80. menu is placed on the screen so that the checked item is at the position (global) top,left.
  81.  
  82.  
  83.  
  84. Thanks to:
  85. Andrew Gilmartin
  86.  Brown University
  87.  
  88.  
  89.  
  90. -- part contents for background part 7
  91. ----- text -----
  92. Syntax:
  93.  
  94. PopUpMenu( <"MenuItems">, <CheckedItem>, <Top>, <Left> )
  95.  
  96. Returns the number of the item selected.
  97.  
  98.  
  99. "MenuItems" is a list of items seperated by commas that will comprise the menu.
  100.  
  101. <CheckedItem> is the number of the item that will be initially selected & checked.
  102.  
  103. <Top> is the vertical placement of the checked item. 
  104.  
  105. <Left> is the horizontal placement of the checked item.